package com.xbongbong.workflow.model.impl;

import com.xbongbong.workflow.domain.dao.WorkflowTaskLogItemDao;
import com.xbongbong.workflow.domain.entity.WorkflowTaskLogItemEntity;
import com.xbongbong.workflow.model.WorkflowTaskLogItemModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author huguojun
 */
@Service("workflowTaskLogItemModel")
public class WorkflowTaskLogItemModelImpl implements WorkflowTaskLogItemModel {

    @Resource
    private WorkflowTaskLogItemDao workflowTaskLogItemDao;

    @Override
    public Integer insert(WorkflowTaskLogItemEntity entity) {
        return workflowTaskLogItemDao.insert(entity);
    }

    @Override
    public void insertBatch(List<WorkflowTaskLogItemEntity> list) {
        workflowTaskLogItemDao.insertBatch(list);
    }

    @Override
    public List<WorkflowTaskLogItemEntity> findEntitys(Map<String, Object> param) {
        return workflowTaskLogItemDao.findEntities(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return workflowTaskLogItemDao.getEntitiesCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer update(WorkflowTaskLogItemEntity entity) {
        return workflowTaskLogItemDao.update(entity);
    }

    @Override
    public WorkflowTaskLogItemEntity getByKey(Long key, String corpid) {
        return workflowTaskLogItemDao.getByKey(key, corpid);
    }

    @Override
    public WorkflowTaskLogItemEntity getByTaskIdNodeId(Long taskId, Long nodeId, String corpid) {
        return workflowTaskLogItemDao.getByTaskIdNodeId(taskId, nodeId, corpid);
    }

    @Override
    public void updateBatch(List<WorkflowTaskLogItemEntity> workflowTaskLogItemEntities, String corpid) {
        workflowTaskLogItemDao.updateBatch(workflowTaskLogItemEntities, corpid);
    }

    @Override
    public WorkflowTaskLogItemEntity getByLogIdNodeIdOrderByAddTime(String corpid, Long logId, Long nodeId) {
        return workflowTaskLogItemDao.getByLogIdNodeIdOrderByAddTime(corpid, logId, nodeId);
    }

    @Override
    public void deleteByTaskIds(String corpid, List<Long> taskIds) {
        workflowTaskLogItemDao.deleteByTaskIds(corpid, taskIds);
    }

}
